﻿@model IEnumerable<RedSand.Site.Models.RoleInfo>
<div class="panel">
    <div class="panel-header">
        <span>@Html.Translate("RoleManager", "Role")</span>
    </div>
    <div class="panel-content">
        <div class="panel-toolbar">
            <ul>
                <li>
                    @Ajax.ActionLink(Html.Translate("Create").ToHtmlString(), "create", null, AdminAjaxOptions.GetForm, new { @class = "btn-create" })
                </li>
            </ul>
        </div>
        @if (Model == null)
        {
            @Html.Translate("DataEmpty", "Message", "div", new { @class = "message warning" })
        }
        else
        {
            <table class="table-list">
                <thead>
                    <tr>
                        <th>
                            @Html.Translate("Name", "Role")
                        </th>
                        <th class="center width80">
                            @Html.Translate("Status")
                        </th>
                        <th class="center width80">
                            @Html.Translate("Control")
                        </th>
                    </tr>
                </thead>
                <tbody>
                    @foreach (var item in Model)
                    {
                        <tr>
                            <td>
                                @Html.Action("GetRoleName", new { name = item.Name })
                            </td>
                            <td class="center">
                                @DropDownListHelper.GetStatusString(item.Status)
                            </td>
                            <td class="center">
                                @Ajax.ActionLink(Html.Translate("Edit").ToHtmlString(), "edit", new { type = ViewBag.Type, id = item.RoleID, count = Model.Count() }, AdminAjaxOptions.GetForm, new { @class = "btn-edit", title = Html.Translate("Edit") })
                                @Ajax.ActionLink(Html.Translate("Delete").ToHtmlString(), "delete", new { type = ViewBag.Type, id = item.RoleID }, AdminAjaxOptions.DeleteRecord, new { @class = "btn-delete", title = Html.Translate("Delete") })
                            </td>
                        </tr>
                    }
                </tbody>
            </table>
        }
    </div>
</div>
